<template>
    <view>
        <block v-for="(item, itemIndex) in diyItems" :key="itemIndex">
            <!-- 搜索框 -->

            <block v-if="item.type === 'search'">
                <diy-search :itemIndex="itemIndex" :itemStyle="item.style" :params="item.params"></diy-search>
            </block>

            <!-- banner轮播 -->

            <block v-if="item.type === 'banner'">
                <diy-banner :itemIndex="itemIndex" :itemStyle="item.style" :params="item.params" :dataList="item.data"></diy-banner>
            </block>

            <!-- 单图组 -->

            <block v-if="item.type === 'imageSingle'">
                <diy-imageSingle :itemIndex="itemIndex" :itemStyle="item.style" :dataList="item.data"></diy-imageSingle>
            </block>

            <!-- 视频组 -->

            <block v-if="item.type === 'video'">
                <diy-video :itemIndex="itemIndex" :itemStyle="item.style" :params="item.params"></diy-video>
            </block>

            <!-- 文章组 -->

            <block v-if="item.type === 'article'">
                <diy-article :itemIndex="itemIndex" :params="item.params" :dataList="item.data"></diy-article>
            </block>

            <!-- 头条快报 -->

            <block v-if="item.type === 'special'">
                <diy-special :itemIndex="itemIndex" :itemStyle="item.style" :params="item.params" :dataList="item.data"></diy-special>
            </block>

            <!-- 公告组 -->

            <block v-if="item.type === 'notice'">
                <diy-notice :itemIndex="itemIndex" :itemStyle="item.style" :params="item.params"></diy-notice>
            </block>

            <!-- 空白组 -->

            <block v-if="item.type === 'blank'">
                <diy-blank :itemIndex="itemIndex" :itemStyle="item.style"></diy-blank>
            </block>

            <!-- 辅助线 -->

            <block v-if="item.type === 'guide'">
                <diy-guide :itemIndex="itemIndex" :itemStyle="item.style"></diy-guide>
            </block>

            <!-- 在线客服 -->

            <block v-if="item.type === 'service'">
                <diy-service :itemIndex="itemIndex" :itemStyle="item.style" :params="item.params"></diy-service>
            </block>

            <!-- 富文本 -->

            <block v-if="item.type === 'richText'">
                <diy-richText :itemIndex="itemIndex" :itemStyle="item.style" :params="item.params"></diy-richText>
            </block>

            <!-- 导航组 -->

            <block v-if="item.type === 'navBar'">
                <diy-navBar :itemIndex="itemIndex" :itemStyle="item.style" :dataList="item.data"></diy-navBar>
            </block>

            <!-- 图片橱窗 -->

            <block v-if="item.type === 'window'">
                <diy-window :itemIndex="itemIndex" :itemStyle="item.style" :dataList="item.data"></diy-window>
            </block>

            <!-- 商品组 -->

            <block v-if="item.type === 'goods'">
                <diy-goods :itemIndex="itemIndex" :itemStyle="item.style" :dataList="item.data"></diy-goods>
            </block>

            <!-- 优惠券组 -->

            <block v-if="item.type === 'coupon'">
                <diy-coupon :itemIndex="itemIndex" :itemStyle="item.style" :dataList="item.data"></diy-coupon>
            </block>

            <!-- 拼团商品 -->

           <!-- <block v-if="item.type === 'sharingGoods'">
                <diy-sharingGoods :itemIndex="itemIndex" :itemStyle="item.style" :dataList="item.data"></diy-sharingGoods>
            </block> -->

            <!-- 砍价商品 -->

            <!-- <block v-if="item.type === 'bargainGoods'">
                <diy-bargainGoods :itemIndex="itemIndex" :itemStyle="item.style" :dataList="item.data"></diy-bargainGoods>
            </block> -->

            <!-- 秒杀商品 -->

            <!-- <block v-if="item.type === 'sharpGoods'">
                <diy-sharpGoods :itemIndex="itemIndex" :itemStyle="item.style" :data="item.data"></diy-sharpGoods>
            </block> -->

            <!-- 线下门店 -->

            <!-- <block v-if="item.type === 'shop'">
                <diy-shop :itemIndex="itemIndex" :itemStyle="item.style" :dataList="item.data"></diy-shop>
            </block> -->

            <!-- 关注公众号 -->

            <block v-if="item.type === 'officialAccount'">
                <diy-officialAccount :itemIndex="itemIndex" :itemStyle="item.style" :dataList="item.data"></diy-officialAccount>
            </block>
        </block>
    </view>
</template>

<script>
import diyBanner from './banner/banner.vue';
import diySearch from './search/search.vue';
import diyImageSingle from './imageSingle/imageSingle.vue';
import diyVideo from './video/video.vue';
import diyArticle from './article/article.vue';
import diySpecial from './special/index.vue';
import diyBlank from './blank/blank.vue';
import diyGuide from './guide/guide.vue';
import diyNavBar from './navBar/navBar.vue';
import diyWindow from './window/window.vue';
import diyGoods from './goods/goods.vue';
import diyCoupon from './coupon/coupon.vue';
import diyNotice from './notice/notice.vue';
import diyService from './service/service.vue';
import diyRichText from './richText/richText.vue';
// import diySharingGoods from './sharingGoods/sharingGoods.vue';
// import diyBargainGoods from './bargainGoods/index.vue';
// import diySharpGoods from './sharpGoods/index.vue';
import diyShop from './shop/index.vue';
import diyOfficialAccount from './officialAccount/index.vue';
export default {
    data() {
        return {
			menu_type: uni.getStorageSync('menu_type'),
		};
    },
    components: {
        diyBanner,
        diySearch,
        diyImageSingle,
        diyVideo,
        diyArticle,
        diySpecial,
        diyBlank,
        diyGuide,
        diyNavBar,
        diyWindow,
        diyGoods,
        diyCoupon,
        diyNotice,
        diyService,
        diyRichText,
        diyOfficialAccount,
		diyShop,
    },
    options: {},
    /**
     * 组件的属性列表
     * 用于组件自定义设置
     */
    props: {
        diyItems: Object
    }
};
</script>
<style>
@import './index.css';
</style>